<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        <div>{{msg}}</div>
        <div>{{reverseString}}</div>
    </div>
<script type="text/javascript" src="../lib/vue.js"></script>
<script>
    var app = new Vue ({
        el: "#app",
        data: {
            msg: "nihao",
        },
        // 每次模板编译都会自动运行。响应式属性改变、视图刷新就会执行
        computed: {
            reverseString : function () {
                return this.msg.split("").reverse().join('');
            }
        }
    })
</script>
</body>
</html>
